package com.xiaozou.enums;

import lombok.Getter;

public enum QuestionType {

    TEXT(0, "文本"),
    PICTURE(1, "图片"),
    VIDEO(2, "视频"),

    VOICE(3, "语音");

    @Getter
    private Integer value;
    private String label;

    QuestionType(Integer value, String label) {
        this.value = value;
        this.label = label;
    }

    public static QuestionType of(Integer value) {
        for (QuestionType type : QuestionType.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return TEXT;
    }

}
